package biz

import (
	"encoding/json"
	"server/base/db"
)

func GetSetting(platform, k string) string {
	var out string
	db.Replica.Get(&out, `select v from setting where platform=? and k=?`, platform, k)
	return out
}

func ParseSetting(platform, k string, o interface{}) error {
	s := GetSetting(platform, k)
	err := json.Unmarshal([]byte(s), o)
	return err
}
